<template>
  <div class="larrypage">
   <header-temp :gid='$route.query.gid' :title='lottery[$route.query.gid].name' :headType='$route.meta.headType'></header-temp>

    <div class="content">
      <div
        class="list"
        v-for="(item,index) in laeeypagelist"
        :key="index"
        @click="handDeails(item)"
      >
        <div class="top">
          <div class="left">第{{item.periodid}}期</div>
          <div></div>
          <div class="right">
            <span>{{item.awardtime}}</span>
            <i></i>
            <span>{{item.awardWeek}}</span>
          </div>
        </div>
        <div class="btn">
          <div class="left">
            <span v-for="(it,index) in redlist[index]" :key="index">{{it}}</span>
            <span
              style="color:#5187FF;"
              v-if="item.bluecode!==''"
              class="cla_lan"
              v-for="(ir,index) in item.bluecode.split(',')"
            >{{ir}}</span>
          </div>
          <div class="right">
            <img src="@/assets/image/lujin_1.png" alt />
          </div>
        </div>
      </div>
      <div style="width:3.75rem;height:.5rem;background-color:rgb(242, 242, 246);"></div>
    </div>

  <!--悬浮广告 -->
  <advert-temp :gid='gid'></advert-temp>
  </div>
</template>

<script>
import { getHistoryAwards } from "@/api/whole";
import { gethistory } from "@/api/user";
import config from "../../config/lottery";
import headerTemp from '@/components/head2'
import advertTemp from '@/components/advert'
export default {
  data() {
    return {
      ishoe: true,
      name: "",
      laeeypagelist: [],
      token: "",
      redlist: [],
      title: "",
      gid: "",
      iarea: "",
    };
  },
  components: {
    headerTemp,
    advertTemp
  },
  methods: {
    getHistory() {
      gethistory({ gid: this.gid }).then(res => {
        this.laeeypagelist = res.data.data.data;
        this.laeeypagelist.forEach(element => {
          let cindar = element.awardcode;
          this.redlist.push(cindar.split(","));
        });
      });
    },

    // 全国
    handDeails(index) {
      this.$router.push({
        path: "/details",
        query: {
          pid: index.periodid,
          gid: index.gameid,
          iarea: this.iarea
        }
      });
    },
    gohoem() {
      this.$router.go(-1);
    },
  },
  created() {
    this.gid = this.$route.query.gid;
    this.iarea = this.$route.query.iarea;
    this.getHistory();
    this.title = this.lottery[this.gid].name;
  }
};
</script>

<style lang="less" scoped>
.larrypage {
  width: 100%;
  height: 100vh;
  background-color: #f1f2f6;

  .content {
    padding: 0 0.13rem 0 0.13rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f1f2f6;
    .list {
      width: 100%;

      border: 1px solid #dbdbdb;
      margin-top: 0.1rem;
      border-radius: 0.12rem;
      background-color: #fff;
      .top {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 0.14rem;
        .left {
          height: 0.18rem;
          font-size: 0.13rem;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: rgba(0, 0, 0, 1);
          line-height: 0.18rem;
          margin-left: 0.2rem;
        }
        .right {
          font-size: 0.12rem;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: rgba(102, 102, 102, 1);
          line-height: 0.17rem;
          margin-right: 0.2rem;
          i {
            width: 0.01rem;
            height: 0.1rem;
            display: inline-block;
            background-color: #e4e4e4;
            margin-left: 0.06rem;
            margin-right: 0.06rem;
          }
          span {
            display: inline-block;
          }
        }
      }
      .btn {
        width: 100%;
        display: flex;
        margin-top: 0.12rem;
        justify-content: space-between;
        margin-bottom: 0.1rem;
        .left {
          font-size: 0.16rem;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          margin-left: 0.2rem;
          span {
            width: 0.17rem;
            height: 0.22rem;
            display: inline-block;
            margin-right: 0.16rem;
            color: rgba(248, 72, 72, 1);
          }
        }
        .right {
          width: 0.2rem;
          height: 0.2rem;
          display: flex;
          align-items: center;
          margin-right: 0.1rem;
          img {
            width: 0.06rem;
            height: 0.12rem;
            display: inline-block;
          }
        }
      }
    }
  }
  .contewer {
    width: 100%;
    height: 100vh;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    .top {
      width: 100%;
      height: 0.2rem;
      line-height: 0.2rem;
      text-align: center;
      font-size: 0.16rem;
      font-family: STHeitiSC-Light, STHeitiSC;
      font-weight: 300;
      display: flex;
      justify-content: center;
      p {
        position: absolute;
        top: 0.72rem;
      }
    }
    .connte {
      position: absolute;
      top: 1.16rem;
      left: 0.52rem;
      display: flex;
      flex-wrap: wrap;
      .box1 {
        width: 0.78rem;
        height: 0.78rem;
        margin-right: 0.1rem;
        margin-bottom: 0.1rem;
        img {
          width: 100%;
          height: 100%;
          display: inline-block;
        }
      }
    }
    .xxoo {
      position: absolute;
      bottom: 1rem;
      width: 100%;
      height: 0.32rem;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 0.32rem;
      }
    }
  }
}
</style>
